package com.greendao;

import java.io.IOException;

import org.greenrobot.greendao.generator.DaoGenerator;
import org.greenrobot.greendao.generator.Entity;
import org.greenrobot.greendao.generator.Schema;

public class MyGenerator {
    public static void main(String[] args) throws IOException,Exception{
        Schema schema=new Schema(2,"com.example.asus.diary_demo.greendao");

        addNote(schema);
        new DaoGenerator().generateAll(schema,"./app/src/main/java");
    }

    private static Entity addNote(Schema schema){
        Entity note=schema.addEntity("Note");

        note.addIdProperty().primaryKey().autoincrement();
        note.addStringProperty("title").notNull();
        note.addStringProperty("body");
        note.addStringProperty("data");
        return note;
    }
}
